system("ls /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/samplefiles_bin > filename.txt");
open(BUFF,"filename.txt");
open(WRBUFF,">out");
@output=<BUFF>;
for($i=0;$i<@output;$i++)
{
        if($output[$i] =~ m/CEL/)
        {
                chomp($output[$i]);
		system(" apt-cel-convert -f text -o /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/samplefiles_asc /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/samplefiles_bin/$output[$i]");
 	}
}
system("rm -rf /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/filename.txt");

system("chmod -R 755 /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/samplefiles_asc/");
system("ls /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/samplefiles_asc > filename.txt");
#system("cd /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/parse_cdf");
open(BUFF,"filename.txt");
@output=<BUFF>;
for($i=0;$i<@output;$i++)
{
        if($output[$i] =~ m/CEL/)
        {
                chomp($output[$i]);
		print WRBUFF $output[$i]."\n";
	#	system("cp /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/samplefiles_asc/$output[$i] /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/parse_cdf/");
                
	system("/usr/bin/perl  /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/parse_cdf/convert3.pl  ".$output[$i]);
	#	system("rm -rf /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/parse_cdf/$output[$i]");
        }
}
system("rm -rf /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/filename.txt");

system("chmod -R 755 /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/samplefiles1/");


system("ls /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/samplefiles1 > filename.txt");
open(BUFF,"filename.txt");
@output=<BUFF>;
for($i=0;$i<@output;$i++)
{
	if($output[$i] =~ m/CEL/)
	{
		chomp($output[$i]);
		#print $output[$i]."\n";
		system("cp /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/samplefiles1/$output[$i] /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/samplefiles1/file/");
		system("source /home/m081429/.bash_profile");
		system("/usr/local/biotools/r/R-2.11.0/bin/Rscript /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/script_conv_frma.R");

		system("rm -rf /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/samplefiles1/file/$output[$i]");
	}
}
system("rm -rf /data1/bsi/bioinf_int/s106381.borawork/data_HTHGU/filename.txt");


